package im.engure.common.loadbalance;

import im.engure.common.registery.URL;

import java.util.List;
import java.util.Random;

public class LoadBalanceUtil {

    public static URL randomPolicy(List<URL> list) {
        if (list == null || list.size() < 1) {
            return null;
        } else {
            return list.get(new Random().nextInt(list.size()));
        }
    }

}
